import {DefaultTheme, defineConfig} from 'vitepress'
import {sidebarVue3} from "../vue3";
import {webpack5} from "../webpack5";
import {miniReact} from "../mini-react";


// https://vitepress.dev/reference/site-config
export default defineConfig({
  head: [['link', { rel: 'icon', href: '/coffee.svg' }]],
  title: "bugscafe doc",
  description: "A VitePress Site",
  themeConfig: {
    outline: {
      label: '本页内容',
      level: [2, 3]
    },
    logo: {
      light: '/coffee.svg',
      dark: '/coffee.svg'
    },
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      { text: '我的简历', link: '/my/wx-info', },
      // { text: 'Vue3源码', link: '/vue3/design-think' }
    ],

    docFooter: {
      prev: '上一页',
      next: '下一页'
    },
    sidebar: {
      '/my/': { base: '/my/', items: sidebarInfo() },
      '/vue3': { base: '/vue3', items: sidebarVue3() },
      '/webpack5': { base: '/webpack5', items: webpack5() },
      '/mini-react': { base: '/mini-react', items: miniReact() }
    },

    socialLinks: [
      { icon: 'github', link: 'https://github.com/vuejs/vitepress' }
    ],

    footer: {
      message: 'bugscafe',
      copyright: 'Copyright © 2025-present Wang Xin',
    },
    search: {
      provider: 'local',
      options:  {
        translations: {
          button: {
            buttonText: '搜索文档',
            buttonAriaLabel: '搜索文档'
          },
          modal: {
            footer: {
              selectText: '选择',
              navigateText: '切换',
              closeText: '关闭',
            },
          }
        }
      }
    },
  },
})
function sidebarInfo(): DefaultTheme.SidebarItem[] {
  return [
    {
      text: '王鑫',
      items: [
        { text: '基本情况', link: 'wx-info' },
        { text: '过往经历', link: 'experience' },
        {
          text: '往期作品',
          base: 'my/projects',
          items:
            [
              {
                text: '仿网易云音乐',
                link: '/wangyiyun'
              },
              {
                text: '小程序直播项目',
                link: '/uni-cloud'
              },
              {
                text: 'H5海报编辑器',
                link: '/h5'
              },
              {
                text: '仿问卷星项目',
                link: '/question'
              },
              {
                text: '脚手架项目',
                link: '/my-cli'
              },
              {
                text: 'Flutter 项目实战',
                link: '/flutter'
              },
              {
                text: 'React Native 项目实战',
                link: '/react-native'
              },
              {
                text: '仿12306购票系统',
                link: '/train'
              },
              {
                text: 'Harmany 项目实战',
                link: '/harmony'
              }
            ]
        }
      ]
    }
  ]
}